// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace Elastic.Clients.Elasticsearch.Serverless.QueryRules;

public partial class QueryRulesNamespacedClient : NamespacedClientProxy
{
	/// <summary>
	/// <para>
	/// Initializes a new instance of the <see cref="QueryRulesNamespacedClient"/> class for mocking.
	/// </para>
	/// </summary>
	protected QueryRulesNamespacedClient() : base()
	{
	}

	internal QueryRulesNamespacedClient(ElasticsearchClient client) : base(client)
	{
	}

	/// <summary>
	/// <para>
	/// Deletes a query rule within a query ruleset.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-rule.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteRuleResponse> DeleteRuleAsync(DeleteRuleRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<DeleteRuleRequest, DeleteRuleResponse, DeleteRuleRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Deletes a query rule within a query ruleset.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-rule.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteRuleResponse> DeleteRuleAsync(DeleteRuleRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteRuleRequestDescriptor, DeleteRuleResponse, DeleteRuleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Deletes a query rule within a query ruleset.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-rule.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteRuleResponse> DeleteRuleAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId, CancellationToken cancellationToken = default)
	{
		var descriptor = new DeleteRuleRequestDescriptor(rulesetId, ruleId);
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteRuleRequestDescriptor, DeleteRuleResponse, DeleteRuleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Deletes a query rule within a query ruleset.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-rule.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteRuleResponse> DeleteRuleAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId, Action<DeleteRuleRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new DeleteRuleRequestDescriptor(rulesetId, ruleId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteRuleRequestDescriptor, DeleteRuleResponse, DeleteRuleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Deletes a query ruleset.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteRulesetResponse> DeleteRulesetAsync(DeleteRulesetRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<DeleteRulesetRequest, DeleteRulesetResponse, DeleteRulesetRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Deletes a query ruleset.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteRulesetResponse> DeleteRulesetAsync(DeleteRulesetRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteRulesetRequestDescriptor, DeleteRulesetResponse, DeleteRulesetRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Deletes a query ruleset.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteRulesetResponse> DeleteRulesetAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, CancellationToken cancellationToken = default)
	{
		var descriptor = new DeleteRulesetRequestDescriptor(rulesetId);
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteRulesetRequestDescriptor, DeleteRulesetResponse, DeleteRulesetRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Deletes a query ruleset.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteRulesetResponse> DeleteRulesetAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Action<DeleteRulesetRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new DeleteRulesetRequestDescriptor(rulesetId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteRulesetRequestDescriptor, DeleteRulesetResponse, DeleteRulesetRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Returns the details about a query rule within a query ruleset
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-rule.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetRuleResponse> GetRuleAsync(GetRuleRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<GetRuleRequest, GetRuleResponse, GetRuleRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Returns the details about a query rule within a query ruleset
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-rule.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetRuleResponse> GetRuleAsync(GetRuleRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<GetRuleRequestDescriptor, GetRuleResponse, GetRuleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Returns the details about a query rule within a query ruleset
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-rule.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetRuleResponse> GetRuleAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetRuleRequestDescriptor(rulesetId, ruleId);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetRuleRequestDescriptor, GetRuleResponse, GetRuleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Returns the details about a query rule within a query ruleset
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-rule.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetRuleResponse> GetRuleAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId, Action<GetRuleRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetRuleRequestDescriptor(rulesetId, ruleId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetRuleRequestDescriptor, GetRuleResponse, GetRuleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Returns the details about a query ruleset
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetRulesetResponse> GetRulesetAsync(GetRulesetRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<GetRulesetRequest, GetRulesetResponse, GetRulesetRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Returns the details about a query ruleset
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetRulesetResponse> GetRulesetAsync(GetRulesetRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<GetRulesetRequestDescriptor, GetRulesetResponse, GetRulesetRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Returns the details about a query ruleset
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetRulesetResponse> GetRulesetAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetRulesetRequestDescriptor(rulesetId);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetRulesetRequestDescriptor, GetRulesetResponse, GetRulesetRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Returns the details about a query ruleset
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetRulesetResponse> GetRulesetAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Action<GetRulesetRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetRulesetRequestDescriptor(rulesetId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetRulesetRequestDescriptor, GetRulesetResponse, GetRulesetRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Returns summarized information about existing query rulesets.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ListRulesetsResponse> ListRulesetsAsync(ListRulesetsRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<ListRulesetsRequest, ListRulesetsResponse, ListRulesetsRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Returns summarized information about existing query rulesets.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ListRulesetsResponse> ListRulesetsAsync(ListRulesetsRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<ListRulesetsRequestDescriptor, ListRulesetsResponse, ListRulesetsRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Returns summarized information about existing query rulesets.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ListRulesetsResponse> ListRulesetsAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new ListRulesetsRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<ListRulesetsRequestDescriptor, ListRulesetsResponse, ListRulesetsRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Returns summarized information about existing query rulesets.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ListRulesetsResponse> ListRulesetsAsync(Action<ListRulesetsRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new ListRulesetsRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<ListRulesetsRequestDescriptor, ListRulesetsResponse, ListRulesetsRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates or updates a query rule within a query ruleset.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-rule.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutRuleResponse> PutRuleAsync(PutRuleRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<PutRuleRequest, PutRuleResponse, PutRuleRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates or updates a query rule within a query ruleset.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-rule.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutRuleResponse> PutRuleAsync(PutRuleRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<PutRuleRequestDescriptor, PutRuleResponse, PutRuleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates or updates a query rule within a query ruleset.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-rule.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutRuleResponse> PutRuleAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId, CancellationToken cancellationToken = default)
	{
		var descriptor = new PutRuleRequestDescriptor(rulesetId, ruleId);
		descriptor.BeforeRequest();
		return DoRequestAsync<PutRuleRequestDescriptor, PutRuleResponse, PutRuleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates or updates a query rule within a query ruleset.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-rule.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutRuleResponse> PutRuleAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId, Action<PutRuleRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new PutRuleRequestDescriptor(rulesetId, ruleId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<PutRuleRequestDescriptor, PutRuleResponse, PutRuleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates or updates a query ruleset.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutRulesetResponse> PutRulesetAsync(PutRulesetRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<PutRulesetRequest, PutRulesetResponse, PutRulesetRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates or updates a query ruleset.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutRulesetResponse> PutRulesetAsync(PutRulesetRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<PutRulesetRequestDescriptor, PutRulesetResponse, PutRulesetRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates or updates a query ruleset.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutRulesetResponse> PutRulesetAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, CancellationToken cancellationToken = default)
	{
		var descriptor = new PutRulesetRequestDescriptor(rulesetId);
		descriptor.BeforeRequest();
		return DoRequestAsync<PutRulesetRequestDescriptor, PutRulesetResponse, PutRulesetRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates or updates a query ruleset.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutRulesetResponse> PutRulesetAsync(Elastic.Clients.Elasticsearch.Serverless.Id rulesetId, Action<PutRulesetRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new PutRulesetRequestDescriptor(rulesetId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<PutRulesetRequestDescriptor, PutRulesetResponse, PutRulesetRequestParameters>(descriptor, cancellationToken);
	}
}